/*!
\copyright  Copyright (c) 2020-2022 Qualcomm Technologies International, Ltd.\n
            All Rights Reserved.\n
            Qualcomm Technologies International, Ltd. Confidential and Proprietary.
\file
\ingroup    adk_test_common Test APIs
\brief      Interface for common LE Audio specifc testing functions.
*/
#ifndef LE_AUDIO_TEST_H
#define LE_AUDIO_TEST_H

#ifdef INCLUDE_LE_AUDIO_UNICAST
#include "le_unicast_manager.h"
#include "call_control_client.h"
#endif

/*! @{ */

/*! \brief Check if LE extended advertsing is enabled.

    Check the state of the le_advertising_manager to see if extended
    advertising is currently active.

    \return TRUE if extended advertising is active, FALSE othrwise.
*/
bool leAudioTest_IsExtendedAdvertisingActive(void);

/*! \brief Check if any LE Broadcast source is active.

    Active means are synced to, or in the process of syncing to,
    a PA and / or BIS.

    \return TRUE if any source is active; FALSE otherwise.
*/
bool leAudioTest_IsBroadcastReceiveActive(void);

/*! \brief Check if any LE Broadcast source is pa synced.

    \return TRUE if any source is pa synced; FALSE otherwise.
*/
bool leAudioTest_IsAnyBroadcastSourceSyncedToPa(void);

/*! \brief Check if any LE Broadcast source is synced to a BIS.

    \return TRUE if any source is BIS synced; FALSE otherwise.
*/
bool leAudioTest_IsAnyBroadcastSourceSyncedToBis(void);

/*! \brief Set the volume during LEA broadcast

    \param volume 0-255
    \return bool TRUE if the volume set request was initiated
                 else FALSE
*/
bool leAudioTest_SetVolumeForBroadcast(uint8 volume);

/*! \brief Set the mute state during LEA broadcast

    \param mute_state TRUE for mute, FALSE for unmute
    \return bool TRUE if the mute request was initiated
                 else FALSE
*/
bool leAudioTest_SetMuteForBroadcast(bool mute_state);

/*! \brief Pause receiving the broadcast stream
    \return bool TRUE if the request was initiated else FALSE.
*/
bool leAudioTest_PauseBroadcast(void);

/*! \brief Resume receiving the broadcast stream.
    \return bool TRUE if the request was initiated else FALSE.
*/
bool leAudioTest_ResumeBroadcast(void);

/*! \brief Query if the broadcast is paused.
    \return TRUE if paused.
*/
bool leAudioTest_IsBroadcastPaused(void);

/*! \brief Set the volume during LEA unicast music

    \param volume 0-255
    \return bool TRUE if the volume set request was initiated
                 else FALSE
*/
bool leAudioTest_SetVolumeForUnicastMusic(uint8 volume);

/*! \brief Set the mute state during LEA unicast music

    \param mute_state TRUE for mute, FALSE for unmute
    \return bool TRUE if the mute request was initiated
                 else FALSE
*/
bool leAudioTest_SetMuteForUnicastMusic(bool mute_state);

/*! \brief Set the volume during LEA unicast voice

    \param volume 0-255
    \return bool TRUE if the volume set request was initiated
                 else FALSE
*/
bool leAudioTest_SetVolumeForUnicastVoice(uint8 volume);

/*! \brief Set the mute state during LEA unicast voice

    \param mute_state TRUE for mute, FALSE for unmute
    \return bool TRUE if the mute request was initiated
                 else FALSE
*/
bool leAudioTest_SetMuteForUnicastVoice(bool mute_state);

/*! \brief Get the VCP volume of the Broadcast audio source

    \return VCP volume of Broadcast source, 0-255
*/
int leAudioTest_GetVolumeForBroadcast(void);

/*! \brief Get the VCP volume of the Unicast audio source

    \return VCP volume of Unicast audio source, 0-255
*/
int leAudioTest_GetVolumeForUnicastMusic(void);

/*! \brief Get the VCP volume of the Unicast Voice source

    \return VCP volume of Unicast voice source, 0-255
*/

int leAudioTest_GetVolumeForUnicastVoice(void);

#ifdef INCLUDE_LE_AUDIO_UNICAST

/*! \brief Increment the volume in steps during LEA unicast music
*/
void leAudioTest_UnicastAudioSinkVolumeUp(void);

/*! \brief Decrement the volume in steps during LEA unicast music
*/
void leAudioTest_UnicastAudioSinkVolumeDown(void);

/*! \brief Increment the volume in steps during LEA unicast voice
*/
void leAudioTest_UnicastVoiceSinkVolumeUp(void);

/*! \brief Decrement the volume in steps during LEA unicast voice
*/
void leAudioTest_UnicastVoiceSinkVolumeDown(void);

/*! \brief Send ASE release request

    \param cid The gatt connection id. If invalid CID is passed, then if any active BAP configuration associated,
               it will be used for search otherwise will return.
    \param ase_id The ASE id for which the ASE release request is to be sent.
*/
void leAudioTest_SendAseReleaseRequest(gatt_cid_t cid, uint8 ase_id);

/*! \brief Send ASE released request

    \param cid The gatt connection id. If invalid CID is passed, then if any active BAP configuration associated,
               it will be used for search otherwise will return.
    \param ase_id The ASE id for which the ASE released request is to be sent.
*/
void leAudioTest_SendAseReleasedRequest(gatt_cid_t cid, uint8 ase_id);

/*! \brief Send ASE Disable request

    \param cid The gatt connection id. If invalid CID is passed, then if any active BAP configuration associated,
               it will be used for search otherwise will return.
    \param ase_id The ASE id for which the ASE Disable request is to be sent.
*/
void leAudioTest_SendAseDisableRequest(gatt_cid_t cid, uint8 ase_id);

/*! \brief Send Ase Configure Codec Req

    \param cid The gatt connection id. If invalid CID is passed, then if any active BAP configuration associated,
               it will be used for search otherwise will return.
    \param ase_id The ASE id for which the ASE disable request is to be sent.
    \param config_set The config set \ref le_um_codec_config_set_t
*/
void leAudioTest_SendAseAseConfigureCodecReq(gatt_cid_t cid, uint8 ase_id, le_um_codec_config_set_t config_set);

/*! \brief Send Ase Metadata Update request

    \param cid The gatt connection id. If invalid CID is passed, then if any active BAP configuration associated,
               it will be used for search otherwise will return.
    \param ase_id The ASE id for which the ASE metadata update req is to be sent.
*/
void leAudioTest_SendAseMetadataUpdateReq(gatt_cid_t cid, uint8 ase_id);

/*! \brief Check if CCP is connected or not

    \return TRUE if CCP is connected
*/
bool leAudioTest_IsCcpConnected(void);

/*! \brief Check if Lea unicast is streaming
    \return True if Lea unicast is streaming.
*/
bool appTestIsLeaUnicastStreaming(void);

/*! \brief Get Lea unicast audio context
    \return Lea Audio context
*/
uint16 appTestLeaUnicastGetAudioContext(void);

/*! \brief Initiates request for reading CIS ISO link quality.

    \return TRUE if any request was initated
*/
bool leAudioTest_ReadUnicastCisLinkQuality(void);

#endif

/*! \brief Check if any handset is connected both BREDR and LE

    \return bool TRUE if a handset is found that has both a BREDR 
                 and LE connection
*/
bool leAudioTest_AnyHandsetConnectedBothBredrAndLe(void);

/*! @} */

#endif // LE_AUDIO_TEST_H
